/**
 * Copyright (C), 2019-2023,
 * FileName: TestCLient
 * Author:   fanxquer
 * Date:     2023/7/6 10:36
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 邱富康           2023/7/6           1.0
 */
package com.hsteach.framework.feign.client.uapi;

import com.hsteach.framework.feign.ClientConstant;
import com.hsteach.framework.feign.client.auth.AuthFeignConfig;
import com.hsteach.framework.feign.client.auth.dto.AuthResp;
import com.hsteach.framework.feign.client.auth.dto.PageResp;
import com.hsteach.framework.feign.client.uapi.vo.*;
import com.hsteach.framework.feign.client.xgk.dto.XgkList;
import com.hsteach.framework.feign.client.xgk.dto.XgkListResult;
import com.hsteach.framework.feign.client.xgk.dto.XgkResult;
import com.hsteach.framework.feign.client.xgk.dto.ret.GetPersonByConditionRet;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 〈〉
 *
 * @author Qiu Fukang
 * @create 2023/7/6
 * @since 1.0.0
 */
@FeignClient(name = "uApiClient", url = "${interface.auth.domain:127.0.0.1:8079}", configuration = AuthFeignConfig.class)
public interface UApiClient {

    /**
     * 获取科室通讯录（分页）
     * @return
     */
    @GetMapping("/system/uapi/edugov/department/teacher/pagelist")
//    @GetMapping("/system/uapi/edugov/contact/department/teacher/pagelist")
    AuthResp<PageResp<DepartTeacher>> pageTeacher(@RequestHeader(ClientConstant.AUTH_ACCESS_TOKEN) String accessToken,
                                                  @RequestHeader(ClientConstant.AUTH_APP_TOKEN) String appToken,
                                                  @RequestHeader(ClientConstant.AUTH_OPERATE_CODE) String operateCode,
                                                  @RequestParam("fetchWorkRoleLevel") Integer fetchWorkRoleLevel,
                                                  @RequestParam("curPageNumber") Integer curPageNumber,
                                                  @RequestParam("pageSize") Integer pageSize);
    /**
     * 获取学校信息列表
     * @return
     */
    @GetMapping("/school/oapi/school/list")
    AuthResp<List<SchoolListVO>> schoolList(@RequestHeader(ClientConstant.AUTH_ACCESS_TOKEN) String accessToken,
                                            @RequestHeader(ClientConstant.AUTH_APP_TOKEN) String appToken,
                                            @RequestHeader(ClientConstant.AUTH_OPERATE_CODE) String operateCode,
                                            @RequestParam("IncludeSubOrg") String IncludeSubOrg
    );
    /**
     * 获取校长通讯录（分页）
     * @return
     */
    @GetMapping("/school/uapi/school/contact/leader/pagelist")
    AuthResp<PageResp<Leader>> pageLeader(@RequestHeader(ClientConstant.AUTH_ACCESS_TOKEN) String accessToken,
                                          @RequestHeader(ClientConstant.AUTH_APP_TOKEN) String appToken,
                                          @RequestHeader(ClientConstant.AUTH_OPERATE_CODE) String operateCode,
                                          @RequestParam("xxlbs") String xxlbs,
                                          @RequestParam("schoolId") String schoolId,
                                          @RequestParam("curPageNumber") Integer curPageNumber,
                                          @RequestParam("pageSize") Integer pageSize,
                                          @RequestParam("fetchAllLeader") Integer fetchAllLeader);

//    /**
//     * 获取单位通讯录（分页）
//     * @return
//     */
//    @GetMapping("/system/uapi/edugov/teacher/pagelist")
//    AuthResp<PageResp<Company>> pageCompany(@RequestHeader(ClientConstant.AUTH_ACCESS_TOKEN) String accessToken,
//                                            @RequestHeader(ClientConstant.AUTH_APP_TOKEN) String appToken,
//                                            @RequestHeader(ClientConstant.AUTH_OPERATE_CODE) String operateCode,
//                                            @RequestParam("curPageNumber") Integer curPageNumber,
//                                            @RequestParam("pageSize") Integer pageSize);


    /**
     * 获取单位通讯录（分页）
     * @return
     */
//    @GetMapping("/system/uapi/edugov/teacher/pagelist")
    @GetMapping("/system/uapi/edugov/contact/teacher/pagelist")
    AuthResp<PageResp<Company>> pageCompany(@RequestHeader(ClientConstant.AUTH_ACCESS_TOKEN) String accessToken,
                                            @RequestHeader(ClientConstant.AUTH_APP_TOKEN) String appToken,
                                            @RequestHeader(ClientConstant.AUTH_OPERATE_CODE) String operateCode,
                                            @RequestParam("fetchWorkRoleLevel") Integer fetchWorkRoleLevel,
                                            @RequestParam("name") String name,
                                            @RequestParam("organizeId") String organizeId,
                                            @RequestParam("type") Integer type,
                                            @RequestParam("curPageNumber") Integer curPageNumber,
                                            @RequestParam("pageSize") Integer pageSize);

    /**
     * 获取单位、部门
     * @return
     */
//    @GetMapping("/system/uapi/edugov/teacher/pagelist")
    @GetMapping("/system/uapi/edugov/organize/list")
    XgkListResult<CompanyAndDept> getCompanyAndDeptList(@RequestHeader(ClientConstant.AUTH_ACCESS_TOKEN) String accessToken,
                                                        @RequestHeader(ClientConstant.AUTH_APP_TOKEN) String appToken,
                                                        @RequestHeader(ClientConstant.AUTH_OPERATE_CODE) String operateCode,
                                                        @RequestParam(ClientConstant.XGK_INCLUDE_DEPARTMENT) Integer includeDepartment);


    /**
     * 条件分页查询人员信息
     * @return
     */
    @GetMapping("/system/uapi/privilege/role/user/pagelist")
    XgkResult<XgkList<GetPersonByConditionRet>> getPersonByCondition(@RequestHeader(ClientConstant.AUTH_ACCESS_TOKEN) String accessToken,
                                                                     @RequestHeader(ClientConstant.AUTH_APP_TOKEN) String appToken,
                                                                     @RequestHeader(ClientConstant.AUTH_OPERATE_CODE) String operateCode,
                                                                     @RequestParam("roleId") String roleId,
                                                                     @RequestParam("name") String name,
                                                                     @RequestParam("nickName") String nickName,
                                                                     @RequestParam("organizeId") String organizeId,
                                                                     @RequestParam("curPageNumber") String curPageNumber,
                                                                     @RequestParam("pageSize") String pageSize);


}
